//
//  CustumUITextField.m
//  UI02_homework01
//
//  Created by aaaaaa on 16/6/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustumUITextField.h"

@implementation CustumUITextField

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


+ (instancetype)customUITextFieldWithFrame:(CGRect)frame withPlaceholder:(NSString *)placeholder{
    CustumUITextField *custom = [[CustumUITextField alloc] initWithFrame:frame];
    custom.placeholder = placeholder;
    [custom setProperty];
    
    return [custom autorelease];
}


- (void)setProperty{
    self.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.layer.borderWidth = 1.0f;
    self.layer.cornerRadius = 5.0;
    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 30)];
    self.leftView = leftView;
    self.leftViewMode = UITextFieldViewModeAlways;
    [leftView release];
}

@end
